package com.itheima.aop;


import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;
import org.springframework.stereotype.Component;

@Component //spring创建对象
@Aspect //当前的类是切面类，定义切点所执行的拦截功能，功能方法叫通知
public class MyAspect {
    /**
     * 通知
     *
     * 切点表达式execution(void com.XLcasd.service.UserServicelmpl.query())
     *
     * **/
    @Around("execution(void com.itheima.service.UserServicelmpl.query())")   //前置通知
    public void advice1(){
        System.out.println("拦截");
    }

}
